﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using POSSystem.BLL;

namespace MobileShop
{
    public partial class OrderDetail : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SessionUser == null || SessionUser.RowCount == 0)
                this.Response.Redirect("Login.aspx?url=MyAccount.aspx");
            if (!IsPostBack)
            {
                rpt.Rebind();
                PageMap = string.Format("My Account[{0}]|Transaction History[{1}]", this.ResolveUrl("~/MyAccount.aspx"), this.ResolveUrl("~/TransactionHistory.aspx"));
            }
        }

        protected void rpt_OnNeedDataSource(object sender, EventArgs e)
        {
            int orderID = int.Parse(Request.QueryString["id"]);
            View_OrderItems items = View_OrderItems.GetOrderItems(orderID);
            rpt.DataSource = items.DefaultView;
        }
    }
}